# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: DonVla <donvla/users.sourceforge/net>
# Contributor: Hervé Cauwelier <herve/oursours/net>

pkgname=python-xapian
_name=xapian-bindings
pkgver=1.4.22
pkgrel=2
epoch=1
pkgdesc="Python bindings for Xapian"
arch=('loong64' 'x86_64')
url="https://xapian.org/docs/bindings/python/"
license=('GPL2')
depends=('gcc-libs' 'glibc' 'python' 'zlib')
makedepends=('util-linux-libs' 'python-sphinx' "xapian-core=$epoch:$pkgver")
source=("https://oligarchy.co.uk/xapian/${pkgver}/${_name}-${pkgver}.tar.xz"{,.asc})
sha512sums=('0d1b615646d1bdf383e4e32ae152c1493a23ad173232929c8153bb311b3f5b6c6728f29f46f703854c9249ffb35cb620eda1d68cf742c2150f628c19ed55c10f'
            'SKIP')
b2sums=('49c71ece1a159a21b95ff8b6d30c5786e6fd2d1744f0a2e27427b83a85ebced6106ab57655715f6e2089bc3e56da32d6f2ad3d71303a1b75316c7d1a61f84cd0'
        'SKIP')
validpgpkeys=('08E2400FF7FE8FEDE3ACB52818147B073BAD2B07') # Olly Betts <olly@debian.org>

prepare() {
  cd "${_name}-${pkgver}"
  autoreconf -vfi
}

build() {
  cd "${_name}-${pkgver}"
  ./configure --prefix=/usr \
              --with-python3
  make
}

check() {
  cd "${_name}-${pkgver}"
  make check
}

package() {
  depends+=('libuuid.so' 'libxapian.so')
  cd "${_name}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -vDm 644 {AUTHORS,ChangeLog,HACKING,NEWS,README,TODO} \
    -t "${pkgdir}/usr/share/doc/${_name}"
}
# vim:set ts=2 sw=2 et:
